<template>
  <div>
    <!-- separator:分隔符 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a :href="$route.path">{{$route.meta.title}}</a></el-breadcrumb-item>
    </el-breadcrumb>
    <el-button type="danger" @click="logout">退出登录</el-button>
  </div>
</template>
<script>
export default {
  methods: {
    // 退出登录
    logout() {
      // 清除用户信息localStorage和vuex
      this.$store.commit('clearUserInfo');
      // 到登录页
      this.$router.push('/login');
    }
  },
};
</script>

<style>
</style>